﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="list.aspx.vb" Inherits="ArduinoPlayground.List" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <strong>
    <h2> List of Arduino Project(s):</h2>
    <p>
        Catagories:
    <a href="list.aspx">Show all</a> | 
    <asp:Repeater ID="Repeater2" runat="server" 
        DataSourceID="ShowCatagories_SqlDataSource">
        <ItemTemplate>
            <a href="list.aspx?CatagoriesName=<%#Eval("CatagoriesName")%>">
            <%#Eval("CatagoriesName")%>
            </a> | 
        </ItemTemplate>
    </asp:Repeater>
    

    </p>
    <p>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White" 
    BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" 
    GridLines="Horizontal" Height="196px" Width="901px" DataKeyNames="ID" >
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="ID" 
                DataNavigateUrlFormatString="/details.aspx?ID={0}" DataTextField="Title" 
                HeaderText="Title" Text="Title" />
            <asp:BoundField DataField="Author" HeaderText="Author" 
                SortExpression="Author" />
            <asp:BoundField DataField="Difficulty" HeaderText="Difficulty" 
                SortExpression="Difficulty" />
            <asp:BoundField DataField="Costs" HeaderText="Costs" 
                SortExpression="Costs" />
            <asp:BoundField DataField="Duration" HeaderText="Duration" 
                SortExpression="Duration" />
            <asp:ImageField DataAlternateTextField="Preview" DataImageUrlField="Preview" 
                HeaderText="Preview">
                <ControlStyle Height="80px" Width="110px" />
            </asp:ImageField>
        </Columns>
    <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
    <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
    <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
    <SortedAscendingCellStyle BackColor="#F7F7F7" />
    <SortedAscendingHeaderStyle BackColor="#4B4B4B" />
    <SortedDescendingCellStyle BackColor="#E5E5E5" />
    <SortedDescendingHeaderStyle BackColor="#242121" />
</asp:GridView>
    </p>

<asp:SqlDataSource ID="ArduinoPlayground_SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ArduinoPlaygroundConnectionString %>" 
    ProviderName="<%$ ConnectionStrings:ArduinoPlaygroundConnectionString.ProviderName %>" 
        
        SelectCommand="SELECT [ID], [Title], [Author], [Difficulty], [Components], [Costs], [Duration], [Preview] FROM [Project] ORDER BY [ID]">
</asp:SqlDataSource>

    <br />

<asp:SqlDataSource ID="ArduinoPlayground_SqlDataSource2" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ArduinoPlaygroundConnectionString %>" 
    ProviderName="<%$ ConnectionStrings:ArduinoPlaygroundConnectionString.ProviderName %>" 
        
        SelectCommand="SELECT DISTINCT [Title], [CatagoriesName], [ID], [Author], [Difficulty], [Costs], [Duration], [Preview] FROM [ProjectCatagoriesView] WHERE ([CatagoriesName] = ?)">
    <SelectParameters>
        <asp:QueryStringParameter Name="CatagoriesName" 
            QueryStringField="CatagoriesName" Type="String" />
    </SelectParameters>
</asp:SqlDataSource>

    <br />
    <br />

    <asp:SqlDataSource ID="ShowCatagories_SqlDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ArduinoPlaygroundConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ArduinoPlaygroundConnectionString.ProviderName %>" 
        SelectCommand="SELECT [CatagoriesName], [ID] FROM [Catagories]">
    </asp:SqlDataSource>
    
</strong>
    <br />

</asp:Content>
